package cn.neusoft.service.impl;

import cn.neusoft.mapper.BusinessMapper;
import cn.neusoft.pojo.Business;
import cn.neusoft.service.IAppService;
import cn.neusoft.service.IBusinessService;
import cn.neusoft.vo.ResultBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AppService implements IAppService {

    @Autowired
    BusinessMapper businessMapper;

    @Override
    public ResultBean getRecommendBusiness() {
        List<Business> all = businessMapper.getAll();
        return all.size()>5?ResultBean.SUCCESS(all.subList(0,5)):ResultBean.SUCCESS(all);
    }

}
